﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.IoTManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.IoTManagement.MeterParameterVMs
{
    public partial class MeterParameterTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._MeterParameter._ParamName")]
        public ExcelPropety ParamName_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.ParamName);
        [Display(Name = "_Model._MeterParameter._ParameterAddress")]
        public ExcelPropety ParameterAddress_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.ParameterAddress);
        [Display(Name = "_Model._MeterParameter._ParamUnit")]
        public ExcelPropety ParamUnit_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.ParamUnit);
        [Display(Name = "_Model._MeterParameter._Description")]
        public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.Description);
        [Display(Name = "_Model._MeterParameter._ParameterDataType")]
        public ExcelPropety ParameterDataType_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.ParameterDataType);
        [Display(Name = "_Model._MeterParameter._Eanble")]
        public ExcelPropety Eanble_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.Eanble);
        [Display(Name = "_Model._MeterParameter._Device")]
        public ExcelPropety Device_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.DeviceId);
        [Display(Name = "_Model._MeterParameter._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.CreateTime, true);
        [Display(Name = "_Model._MeterParameter._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.UpdateTime, true);
        [Display(Name = "_Model._MeterParameter._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.CreateBy);
        [Display(Name = "_Model._MeterParameter._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.UpdateBy);
        [Display(Name = "_Model._MeterParameter._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.IsValid);
        [Display(Name = "_Model._MeterParameter._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<MeterParameter>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Device_Excel.DataType = ColumnDataType.ComboBox;
            Device_Excel.ListItems = DC.Set<MeterDevice>().GetSelectListItems(Wtm, y => y.DeviceCode.ToString());

        }

    }

    public class MeterParameterImportVM : BaseImportVM<MeterParameterTemplateVM, MeterParameter>
    {
            //import

    }

}